package com.central.scheduler.master.dispatch.executor.context;

import com.central.scheduler.master.dispatch.enums.ExecutorType;
import com.central.scheduler.remote.command.Command;
import com.central.scheduler.remote.utils.Host;

/**
 * @author Tindy
 * @date 2021/11/5
 * @describe
 *  execution context
 */
public class ExecutionContext {

    /**
     * host
     */
    private Host host;

    /**
     *  command
     */
    private final Command command;

    /**
     *  executor type : worker or client
     */
    private final ExecutorType executorType;

    /**
     *  worker group id
     */
    private Long workerGroupId;


    public ExecutionContext(Command command, ExecutorType executorType, Long workerGroupId) {
        this.command = command;
        this.executorType = executorType;
        this.workerGroupId = workerGroupId;
    }

    public Command getCommand() {
        return command;
    }

    public ExecutorType getExecutorType() {
        return executorType;
    }

    public void setWorkerGroupId(Long workerGroupId) {
        this.workerGroupId = workerGroupId;
    }


    public Long getWorkerGroupId(){
        return this.workerGroupId;
    }

    public Host getHost() {
        return host;
    }

    public void setHost(Host host) {
        this.host = host;
    }
}
